package cn.cupk.logsystem.log.decoratorPattern;

import cn.cupk.logsystem.log.LogRecord;
import cn.cupk.logsystem.log.observerPattern.Handler;

// 具体的装饰器类可以实现额外的功能
public class TimestampHandlerDecorator extends HandlerDecorator {
    public TimestampHandlerDecorator(Handler handler) {
        super(handler);
    }

    @Override
    public void publish(LogRecord record) {
        // 添加时间戳或其他功能
        wrappedHandler.publish(record);
    }

    @Override
    public void flush() {
        wrappedHandler.flush();
    }

    @Override
    public void close() throws SecurityException {
        wrappedHandler.close();
    }
}
